#!/bin/bash
###
 # @Author: xiangru.xiao xiangru.xiao@mthreads.com
 # @Date: 2023-05-23 19:35:27
 # @LastEditors: xiangru.xiao xiangru.xiao@mthreads.com
 # @LastEditTime: 2023-05-24 18:22:42
 # Copyright (c) 2023 by Moore Threads, All Rights Reserved. 
### 
workdir=$(cd `dirname $0`; pwd)
sed -i -e 's/musa/cuda/g' ${workdir}/../include/cucheck.h
sed -i -e 's/musa/cuda/g' ${workdir}/../include/kernel.cuh
sed -i -e 's/musa/cuda/g' ${workdir}/../thirdparty/cucheck.cpp
sed -i -e 's/musa/cuda/g' ${workdir}/../thirdparty/cudeviceinfo.cpp
sed -i -e 's/musa/cuda/g' ${workdir}/../thirdparty/cuevent.cpp
sed -i -e 's/musa/cuda/g' ${workdir}/../example/bs-download-speed/bs-download-speed.cu
sed -i -e 's/musa/cuda/g' ${workdir}/../example/bs-readback-speed/bs-readback-speed.cu
sed -i -e 's/musa/cuda/g' ${workdir}/../example/gmem-read-bw/gmem-read-bw.cu
sed -i -e 's/musa/cuda/g' ${workdir}/../example/maxdp-compute/maxdp-compute.cu
sed -i -e 's/musa/cuda/g' ${workdir}/../example/maxhalf-compute/maxhalf-compute.cu
sed -i -e 's/musa/cuda/g' ${workdir}/../example/maxint-compute/maxint-compute.cu
sed -i -e 's/musa/cuda/g' ${workdir}/../example/maxsp-compute/maxsp-compute.cu
sed -i -e 's/musa/cuda/g' ${workdir}/../example/fft-test/fft-test.cu
sed -i -e 's/mufft/cufft/g' ${workdir}/../example/fft-test/fft-test.cu
sed -i -e 's/MUFFT/CUFFT/g' ${workdir}/../example/fft-test/fft-test.cu
sed -i -e 's/mufft/cufft/g' ${workdir}/../include/cucheck.h
sed -i -e 's/MUFFT/CUFFT/g' ${workdir}/../include/cucheck.h
sed -i -e 's/mufft/cufft/g' ${workdir}/../thirdparty/cucheck.cpp
sed -i -e 's/MUFFT/CUFFT/g' ${workdir}/../thirdparty/cucheck.cpp
sed -i -e 's/musa/cuda/g' ${workdir}/../example/gemm-test/gemm-test.cu
sed -i -e 's/mublas/cublas/g' ${workdir}/../example/gemm-test/gemm-test.cu
sed -i -e 's/MUBLAS/CUBLAS/g' ${workdir}/../example/gemm-test/gemm-test.cu
sed -i -e 's/mublas.h/cublas_v2.h/g' ${workdir}/../include/cucheck.h
sed -i -e 's/mublas/cublas/g' ${workdir}/../include/cucheck.h
sed -i -e 's/MUBLAS/CUBLAS/g' ${workdir}/../include/cucheck.h
sed -i -e 's/mublas/cublas/g' ${workdir}/../thirdparty/cucheck.cpp
sed -i -e 's/MUBLAS/CUBLAS/g' ${workdir}/../thirdparty/cucheck.cpp